<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
<ui:composition template="../../WEB-INF/templates/UserTemplate.xhtml">
	<ui:define name="content">
		<h:form id="chatRoomForm">
			
			<p:growl id="growl" showDetail="true" life="3000" />
		
			<p:panel id="panel" header="Liste des conversations en cours">
				<p:dataList value="#{chatRoom.conversations}" var="conversation" itemType="disc"> 
				    <h:link value="#{conversation.project.proName}, #{conversation.conDayTimeBegin}" outcome="/xhtml/user/chat" >
						<f:param name="conId" value="#{conversation.conId}" />
					</h:link>
				</p:dataList>  
			</p:panel>
		</h:form>
		
		<h:form id="formCreateConv">
			
			<p:dataList var="contact" value="#{login.coWorkers}" id="contactList" itemType="square">
				
				#{contact.key.proName} :
				
				<p:dataList var="emp" value="#{contact.value}" id="empList" itemType="circle">
					<p:growl id="messages" showDetail="true" />
					<p:commandLink value="#{emp.empLastname}, #{emp.empFirstname}" action="#{conversationRequestHandler.addConversationRequest(contact.key.proId, emp.empId)}" update="empList" />
				</p:dataList>				
			</p:dataList>
		</h:form>
	</ui:define>
</ui:composition>
</html>